package com.hssy.wululuaplan.controller;

import com.hssy.wululuaplan.common.Result;
import com.hssy.wululuaplan.entity.ClassRemain;
import com.hssy.wululuaplan.service.ClassRemainService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "剩余课时")
@RestController
@RequestMapping("/wululuaplan/hour-remain")
public class HourRemainController {
    @Resource
    private ClassRemainService classRemainService;

    @ApiOperation("指定学生的剩余课时")
    @GetMapping("/findByStudentId")
    public Result<ClassRemain> findByStudentId(@RequestParam("studentId") Integer studentId) {
        ClassRemain classRemain = classRemainService.findByStudentId(studentId);
        return Result.success(classRemain);
    }
}
